package com.itheima.health.dao;

import com.itheima.health.pojo.Member;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 会员DAO
 */
@Component
@Mapper
public interface MemberDao {

    //计算总会员数
    Integer selectCountTotalMember();


    //根据入会日期计算会员数
    Integer selectCountNewMemberByDate(@Param("regTime") String regTime);

    /**
     * 根据月份查询会员数量
     * @param months
     */
    Integer findMemberCountBeforeDate(@Param("value") String months);

    /**
     * 添加新的会员
     * @param member 会员信息
     */
    void insertMember(Member member);

    /**
     * 根据电话号码查询指定用户
     * @param telephone 电话号码
     */
    Member selectMemberByPhone(String telephone);

    /**
     * 更新会员信息
     * @param member 会员信息
     */
    void updateMember(Member member);
}
